﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace EWPlatAPP.UControls
{
        public partial class UIconButton : Button
        {
                public UIconButton()
                {
                        InitializeComponent();
                        //尺寸  字体  字号  FlatStyle FlatAppearance  ForeColor
                        this.Size = new Size(30, 30);
                        this.Font = new Font("Webdings", 10.8F);
                        this.FlatStyle = FlatStyle.Flat;
                        this.FlatAppearance.BorderSize = 0;
                        this.Text = "0";
                        this.ForeColor = Color.Silver;
                        this.BackColor = Color.Transparent;
                        this.TextAlign = ContentAlignment.MiddleCenter;
                }

                protected override void OnMouseEnter(EventArgs e)
                {
                        base.OnMouseEnter(e);
                        this.BackColor = Color.LightGray;
                }

                protected override void OnMouseLeave(EventArgs e)
                {
                        base.OnMouseLeave(e);
                        this.BackColor = Color.Transparent;
                }

                /// <summary>
                /// 不显示聚焦框
                /// </summary>
                protected override bool ShowFocusCues
                {
                        get { return false; }
                }
        }
}
